/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-11-09 14:47:52
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 查询职位列表
export function getUserInfoList() {
const url = `${SERVER.DMSCLOUD_BASEDATA}/basedata/users/loginuser`
return axios.get(url)
}

// 修改密码
export const supereditpassword = (params = {}) => {
const url = `${SERVER.DMSCLOUD_BASEDATA}/basedata/users/editpassword`
return axios.put(url, params)
}

// 查询部门
export function getDeptList() {
const url = `${SERVER.DMSCLOUD_BASEDATA}/basedata/orgs/getIsValid/Orgs`
return axios.get(url)
}

// 职务
export function getPositionList() {
const url = `${SERVER.DMSCLOUD_BASEDATA}/basedata/positions/duty/dicts`
return axios.get(url)
}

// tc_code checkebox
export const findTcCodeByType = (id) => {
const url = `${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/findTcCodeByType/${id}`
return axios.get(url, {
id: Number(id)
})
}
//提交
export const editConfirm = (params = {}) => {
const url = `${SERVER.DMSCLOUD_BASEDATA}/basedata/users/loginuser`
return axios.put(url, params)
}

// 获取微信验证码 
export const sendSms = phone => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/login/sendSms?smsType=1&phone=${phone}`);

//绑定手机号
export const updatePhone = params => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/updatePhone`,params);
//绑定微信获取code
export const getWeChatBinding = phone => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/getWeChatBinding`);
//传code
export const postCallback = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/callback`,params);
//绑定微信号
export const updateWeChatBinding = params => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/updateWeChatBinding`,params);

